#include <iostream>
#include <string>

using namespace std;

template <typename T>
void print_all(const T& S)
{
        for (const auto& x : S)
                cout << x;
        cout << endl;
}

template <typename iterator>
void print(iterator left, iterator right)
{
        for (auto iter = left; iter != right; iter++)
                cout << *iter;
        cout << endl;
}

template <typename iterator, typename T>
void reverse(iterator start, iterator end, T N, string& A)
{
        if (N <= 1)
                return;
        swap(*start, *end);
        print_all(A);
        reverse(++start, --end, N-2, A);
}

int main()
{
        string A;
        int N;
        cin >> N >> A;
        reverse(A.begin(), A.end() - 1, N, A);
        cout << endl;
        print_all(A);
        return 0;
}